{% extends "FOSUserBundle::layout.html.twig" %}

{% block fos_user_content %}
{% if error %}
    <div class="error">{{ error|trans({}, 'FOSUserBundle') }}</div>
{% endif %}

<form action="{{ path("fos_user_security_check") }}" method="post">
    <input type="hidden" name="_csrf_token" value="{{ csrf_token }}" />
	<div>
	    <label for="username">{{ 'security.login.username'|trans({}, 'FOSUserBundle') }}</label>
	    <input type="text" id="username" name="_username" value="{{ last_username }}" required="required" />
	</div>
	<div>
	    <label for="password">{{ 'security.login.password'|trans({}, 'FOSUserBundle') }}</label>
	    <input type="password" id="password" name="_password" required="required" />
	</div>
	<div id="remember">
	    <label for="remember_me" class="remember" >{{ 'security.login.remember_me'|trans({}, 'FOSUserBundle') }}</label>
	    <input type="checkbox" id="remember_me"  style="display:none;" name="_remember_me" value="on" />
	</div>
    <input type="submit" id="_submit" name="_submit" value="{{ 'security.login.submit'|trans({}, 'FOSUserBundle') }}" />
</form>
<script type="text/javascript">
	$(document).ready(function() {
		$('#remember .remember').click(function(){
			var id =$(this).parent();
			if(id.attr("class")=="coched"){
				id.removeClass('coched');
				id.find('input').attr("coched",false);
			}else{
				id.addClass('coched');
				id.find('input').attr("coched",true);
			}
		});
	});
</script>
{% endblock fos_user_content %}
